{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            {include file="public/tophead" /}
            <form class="form-horizontal" method="post">
                <div class="tabs-container">
                    <ul class="nav nav-tabs">
                        <li class="active">
                            <a data-toggle="tab" href="#tab-1" aria-expanded="false">OSS配置</a>
                        </li>
                        <li class="">
                            <a data-toggle="tab" href="#tab-2" aria-expanded="false">环信Im</a>
                        </li>
                        <li class="">
                            <a data-toggle="tab" href="#tab-3" aria-expanded="false">微信</a>
                        </li>
                        <li class="">
                            <a data-toggle="tab" href="#tab-4" aria-expanded="false">支付宝</a>
                        </li>
                        <li class="">
                            <a data-toggle="tab" href="#tab-5" aria-expanded="false">极光</a>
                        </li>
                        <li class="">
                            <a data-toggle="tab" href="#tab-6" aria-expanded="false">网易易盾</a>
                        </li>
                        <li class="">
                            <a data-toggle="tab" href="#tab-7" aria-expanded="false">IOS</a>
                        </li>
                    </ul>
                    <div class="tab-content">

                        <div id="tab-1" class="tab-pane active">
                            <div class="ibox-content">
                                {php}
                                $oss = sysConfig('oss');
                                {/php}

                                <div class="form-group">
                                    <label class="col-sm-2 control-label">accessKeyId：
                                        {if $development_display}<br><span style="color: red;">oss[accessKeyId]</span>{/if}</label>
                                    <div class="col-sm-9">
                                        <input type="text" name="oss[accessKeyId]" value="{present name="$oss['accessKeyId']"}{$oss['accessKeyId']}{/present}"
                                        required="required" class="form-control" />
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">accessKeySecret：
                                        {if $development_display}<br><span
                                                style="color: red;">oss[accessKeySecret]</span>{/if}
                                    </label>
                                    <div class="col-sm-9">
                                        <input type="text" name="oss[accessKeySecret]" value="{present name="$oss['accessKeySecret']"}{$oss['accessKeySecret']}{/present}"
                                        required="required" class="form-control" />
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">endpoint：
                                        {if $development_display}<br><span style="color: red;">oss[endpoint]</span>{/if}
                                    </label>
                                    <div class="col-sm-9">
                                        <input type="text" name="oss[endpoint]" value="{present name="$oss['endpoint']"}{$oss['endpoint']}{/present}"
                                        required="required" class="form-control" />
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">bucket：
                                        {if $development_display}<br><span style="color: red;">oss[oss_bucket]</span>{/if}
                                    </label>
                                    <div class="col-sm-9">
                                        <input type="text" name="oss[bucket]" value="{present name="$oss['bucket']"}{$oss['bucket']}{/present}"
                                        required="required" class="form-control" />
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">securityToken：
                                        {if $development_display}<br><span style="color: red;">oss[securityToken]</span>{/if}
                                    </label>
                                    <div class="col-sm-9">
                                        <input type="text" name="oss[securityToken]" value="{present name="$oss['securityToken']"}{$oss['securityToken']}{/present}"
                                        required="required" class="form-control" />
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div id="tab-2" class="tab-pane">
                            <div class="ibox-content">
                                {php}
                                $easemob = sysConfig('easemob');
                                {/php}
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">app_key：
                                        {if $development_display}<br><span style="color: red;">easemob[app_key]</span>{/if}
                                    </label>
                                    <div class="col-sm-9">
                                        <input type="text" name="easemob[app_key]" value="{present name="$easemob['app_key']"}{$easemob['app_key']}{/present}"
                                        required="required" class="form-control" />
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">org_name：
                                        {if $development_display}<br><span style="color: red;">easemob[org_name]</span>{/if}
                                    </label>
                                    <div class="col-sm-9">
                                        <input type="text" name="easemob[org_name]" value="{present name="$easemob['org_name']"}{$easemob['org_name']}{/present}"
                                        required="required" class="form-control" />
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-2 control-label">app_name：
                                        {if $development_display}<br><span style="color: red;">easemob[app_name]</span>{/if}
                                    </label>
                                    <div class="col-sm-9">
                                        <input type="text" name="easemob[app_name]" value="{present name="$easemob['app_name']"}{$easemob['app_name']}{/present}"
                                        required="required" class="form-control" />
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">client_id：
                                        {if $development_display}<br><span style="color: red;">easemob[client_id]</span>{/if}
                                    </label>
                                    <div class="col-sm-9">
                                        <input type="text" name="easemob[client_id]" value="{present name="$easemob['client_id']"}{$easemob['client_id']}{/present}"
                                        required="required" class="form-control" />
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-2 control-label">client_secret：
                                        {if $development_display}<br><span
                                                style="color: red;">easemob[client_secret]</span>{/if}
                                    </label>
                                    <div class="col-sm-9">
                                        <input type="text" name="easemob[client_secret]" value="{present name="$easemob['client_secret']"}{$easemob['client_secret']}{/present}"
                                        required="required" class="form-control" />
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div id="tab-3" class="tab-pane">
                            <div class="ibox-content">
                                <div class="form-group-title">开放平台</div>
                                {php}
                                $weChatOpen = sysConfig('wechat_open');
                                {/php}
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">AppID:
                                        {if $development_display}
                                        <br><span style="color: red;">wechat_open[app_id]</span>
                                        {/if}
                                    </label>
                                    <div class="col-sm-9">
                                        <input type="text" name="wechat_open[app_id]"  class="form-control" value="{$weChatOpen['app_id']|default=""}" />
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">AppSecret:
                                        {if $development_display}
                                        <br><span style="color: red;">wechat_open[app_secret]</span>
                                        {/if}
                                    </label>
                                    <div class="col-sm-9">
                                        <input type="text" name="wechat_open[app_secret]"  class="form-control" value="{$weChatOpen['app_secret']|default=""}" />
                                    </div>
                                </div>

                                <div class="form-group-title">APP支付</div>
                                {php}
                                $weChatPay = sysConfig('wechat_pay');
                                {/php}
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">应用ID:
                                        {if $development_display}
                                        <br><span style="color: red;">wechat_pay[appid]</span>
                                        {/if}
                                        </label>
                                    <div class="col-sm-9">
                                        <input type="text" name="wechat_pay[appid]"  class="form-control" value="{$weChatPay['appid']|default=""}" />
                                        <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 微信开放平台审核通过的应用APPID（请登录open.weixin.qq.com查看，注意与公众号的APPID不同）</span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">商户号:
                                        {if $development_display}
                                        <br><span style="color: red;">wechat_pay[mch_id]</span>
                                        {/if}
                                    </label>
                                    <div class="col-sm-9">
                                        <input type="text" name="wechat_pay[mch_id]"  class="form-control" value="{$weChatPay['mch_id']|default=""}" />
                                         </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-2 control-label">密钥key:
                                        {if $development_display}
                                        <br><span style="color: red;">wechat_pay[key]</span>
                                        {/if}
                                    </label>
                                    <div class="col-sm-9">
                                        <input type="text" name="wechat_pay[key]"  class="form-control" value="{$weChatPay['key']|default=""}" />
                                        <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> key为商户平台设置的密钥key</span>

                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-2 control-label">设置回调地址:</label>
                                    <div class="col-sm-9">
                                        <input type="text" readonly="readonly"  class="form-control" value="{:config('app.wechat.pay.notify_url')}" />
                                    </div>
                                </div>

                            </div>
                        </div>


                        <div id="tab-4" class="tab-pane">
                            {php}
                            $alipay = sysConfig('alipay');
                            {/php}
                            <div class="ibox-content">
                                <div class="form-group-title">APP支付</div>

                                <div class="form-group">
                                    <label class="col-sm-2 control-label">app_id(开发平台应用id):
                                        {if $development_display}
                                        <br><span style="color: red;">alipay[app_id]</span>
                                        {/if}
                                    </label>
                                    <div class="col-sm-9">
                                        <input type="text" name="alipay[app_id]"  class="form-control" value="{$alipay['app_id']|default=""}" />
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">验签方式 (SIGN_TYPE)：
                                        {if $development_display}
                                        <br><span style="color: red;">alipay[sign_type]</span>
                                        {/if}</label>
                                    <div class="col-sm-9">
                                        <div class="radio i-checks">
                                            <label><input type="radio" value="RSA" name="alipay[sign_type]"  {if isset($alipay['sign_type']) && $alipay['sign_type']=='RSA'}checked="checked"{/if}/> RSA</label>
                                            <label><input type="radio" value="RSA2" name="alipay[sign_type]" {if isset($alipay['sign_type']) && $alipay['sign_type']=='RSA2'}checked="checked"{/if} />RSA2</label>
                                            <!--<label><input type="radio" value="seven_csattle" name="file_store" {if sysConfig('file_store') eq 'seven_csattle'}checked="checked"{/if} /> 七牛</label>-->
                                        </div>
                                        <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 请选择正确的验证签名方式，否则支付宝支付不起作用(建议使用RSA2)</span>
                                    </div>
                                </div>


                                <div class="form-group">
                                    <label class="col-sm-2 control-label">支付宝公钥(PUBLIC_KEY)：
                                        {if $development_display}
                                        <br><span style="color: red;">alipay[public_key]</span>
                                        {/if}</label></label>
                                    <div class="col-sm-2">
                                        <div class="input-group">
                                            <button type="button" class="layui-btn" id="public_key"><i class="layui-icon"></i>上传支付宝公钥</button>
                                        </div>
                                    </div>
                                    <div class="col-sm-8">
                                        <div class="input-group">
                                        <input type="text" name="alipay[public_key]" id="alipay_public_key"  readonly="readonly" class="form-control" value="{$alipay['public_key']|default=''}"></div>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-2 control-label">应用私钥(PRIVATE_KEY)：
                                        {if $development_display}
                                        <br><span style="color: red;">alipay[private_key]</span>
                                        {/if}</label>
                                    <div class="col-sm-2">
                                        <div class="input-group">
                                            <button type="button" class="layui-btn" id="private_key"><i class="layui-icon"></i>上传应用私钥</button>

                                        </div>
                                    </div>
                                    <div class="col-sm-8">
                                        <div class="input-group">
                                        <input type="text" name="alipay[private_key]"  readonly="readonly" id="alipay_private_key" class="form-control" value="{$alipay['private_key']|default=''}">
                                        </div>
                                        </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-2 control-label">设置回调地址:</label>
                                    <div class="col-sm-9">
                                        <input type="text" readonly="readonly"  class="form-control" value="{:config('app.alipay.pay.notify_url')}" />
                                    </div>
                                </div>


                            </div>
                        </div>

                        <div id="tab-5" class="tab-pane">
                            {php}
                            $jpush = sysConfig('jpush');
                            {/php}
                            <div class="ibox-content">
                                <div class="form-group-title">推送</div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">AppKey
                                        {if $development_display}
                                        <br><span style="color: red;">jpush[app_key]</span>
                                        {/if}
                                    </label>
                                    <div class="col-sm-9">
                                        <input type="text" name="jpush[app_key]"  class="form-control" value="{$jpush['app_key']|default=""}" />
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-2 control-label">Master Secret
                                        {if $development_display}
                                        <br><span style="color: red;">jpush[master_secret]</span>
                                        {/if}
                                    </label>
                                    <div class="col-sm-9">
                                        <input type="text" name="jpush[master_secret]"  class="form-control" value="{$jpush['master_secret']|default=""}" />
                                    </div>
                                </div>



                            </div>
                        </div>

                        <div id="tab-6" class="tab-pane">
                            {php}
                            $yidun = sysConfig('yidun');
                            {/php}
                            <div class="ibox-content">
                                <div class="form-group-title">易盾公共参数</div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">产品秘钥 id:
                                        {if $development_display}
                                        <br><span style="color: red;">yidun[secretId]</span>
                                        {/if}
                                    </label>
                                    <div class="col-sm-9">
                                        <input type="text" name="yidun[secretId]"  class="form-control" value="{$yidun['secretId']|default=""}" />
                                        <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 产品秘钥 id ，在网易易盾创建产品时统一分配，产品标识</span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">产品秘钥 secretKey:
                                        {if $development_display}
                                        <br><span style="color: red;">yidun[secretKey]</span>
                                        {/if}
                                    </label>
                                    <div class="col-sm-9">
                                        <input type="text" name="yidun[secretKey]"  class="form-control" value="{$yidun['secretKey']|default=""}" />
                                        <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 产品秘钥 id ，在网易易盾创建产品时统一分配，产品标识</span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">接口版本号:
                                        {if $development_display}
                                        <br><span style="color: red;">yidun[version]</span>
                                        {/if}
                                    </label>
                                    <div class="col-sm-9">
                                        <input type="text" name="yidun[version]"  class="form-control" value="{$yidun['version']|default=""}" />
                                        <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 接口版本号，可选值 v1</span>
                                    </div>
                                </div>


                                <div class="form-group-title">验证</div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">活体检测 业务id:
                                        {if $development_display}
                                        <br><span style="color: red;">yidun[living][businessId]</span>
                                        {/if}
                                    </label>
                                    <div class="col-sm-9">
                                        <input type="text" name="yidun[living][businessId]" class="form-control"   value="{present name="yidun['living']['businessId']"}{$yidun['living']['businessId']}{/present}" />
                                        <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 业务id ，在网易易盾创建产品时统一分配，业务标识</span>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-2 control-label">人脸对比 业务id:
                                        {if $development_display}
                                        <br><span style="color: red;">yidun[face][businessId]</span>
                                        {/if}
                                    </label>
                                    <div class="col-sm-9">
                                        <input type="text" name="yidun[face][businessId]" class="form-control"   value="{present name="yidun['face']['businessId']"}{$yidun['face']['businessId']}{/present}" />
                                        <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 业务id ，在网易易盾创建产品时统一分配，业务标识</span>
                                    </div>
                                </div>

                            </div>
                        </div>


                        <div id="tab-7" class="tab-pane">
                            {php}
                            $apple = sysConfig('apple');
                            {/php}
                            <div class="ibox-content">
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">审核状态：
                                        {if $development_display}
                                        <br><span style="color: red;">apple[status]</span>
                                        {/if}
                                    </label>
                                    <div class="col-sm-9">
                                        <div class="radio i-checks">
                                            <label><input type="radio" value="1" name="apple[status]"  {if isset($apple['status']) && $apple['status']==1}checked="checked"{/if} /> 启用</label>
                                            <label><input type="radio" value="0" name="apple[status]"  {if (isset($apple['status']) && $apple['status']==0) || !isset($apple['status'])}checked="checked"{/if} /> 禁用</label>
                                            <!--<label><input type="radio" value="seven_csattle" name="file_store" {if sysConfig('file_store') eq 'seven_csattle'}checked="checked"{/if} /> 七牛</label>-->
                                        </div>
                                    </div>
                                </div>


                            </div>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
{include file="public/footer" /}
{load href="__STYLE__/admin/plugins/iCheck/icheck.min.js"}
{load href="__STYLE__/admin/plugins/iCheck/custom.css"}
<script type="text/javascript">
    $(document).ready(function () {
        $(".i-checks").iCheck({
            checkboxClass: "icheckbox_square-green",
            radioClass: "iradio_square-green",
        });
    });
</script>
<script>
    layui.use('upload', function(){
        var $ = layui.jquery
            ,upload = layui.upload;


        //指定允许上传的文件类型
        upload.render({
            elem: '#public_key'
            ,url: "{:url('index/uploadKey', ['type' => 'public_key'])}" //改成您自己的上传接口
            ,accept: 'file' //普通文件
            ,field:'public_key'
            ,done: function(res){
                layer.msg(res.msg);
                if(res.code==200){
                    $('#alipay_public_key').val(res.result);
                }
            }
        });
        upload.render({
            elem: '#private_key'
            ,url:  "{:url('index/uploadKey', ['type' => 'private_key'])}" //改成您自己的上传接口
            ,accept: 'file' //普通文件
            ,field:'private_key'
            ,done: function(res){
                layer.msg(res.msg);
                if(res.code==200){
                    $('#alipay_private_key').val(res.result);
                }
            }
        });

    });
</script>
{include file="public/bottom" /}